# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Common_TargetImpressionShare do
  @moduledoc """
  An automated bidding strategy that sets bids so that a certain percentage of search ads are shown at the top of the first page (or other targeted location).

  ## Attributes

  *   `cpcBidCeilingMicros` (*type:* `String.t`, *default:* `nil`) - The highest CPC bid the automated bidding system is permitted to specify. This is a required field entered by the advertiser that sets the ceiling and specified in local micros.
  *   `location` (*type:* `String.t`, *default:* `nil`) - The targeted location on the search results page.
  *   `locationFractionMicros` (*type:* `String.t`, *default:* `nil`) - The chosen fraction of ads to be shown in the targeted location in micros. For example, 1% equals 10,000.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :cpcBidCeilingMicros => String.t() | nil,
          :location => String.t() | nil,
          :locationFractionMicros => String.t() | nil
        }

  field(:cpcBidCeilingMicros)
  field(:location)
  field(:locationFractionMicros)
end

defimpl Poison.Decoder,
  for: GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Common_TargetImpressionShare do
  def decode(value, options) do
    GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Common_TargetImpressionShare.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Common_TargetImpressionShare do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
